package com.iupon.tools.springevent.controller;

import com.iupon.tools.springevent.entity.RequestVO;
import com.iupon.tools.springevent.event.PlayerOnLoginEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MapController {

    /**
     * 通过@Order可以指定加载顺序
     * @param playerOnLoginEvent
     */
    @EventListener
    @Order(2)
    public void initPlayerInfo(PlayerOnLoginEvent<RequestVO> playerOnLoginEvent){
        log.info("初始化地图信息:{}",playerOnLoginEvent.getRequestVO());
    }
}
